var count = 0;
addDiagnosisContent1 = function () {
    var id= $("#customerId").val();
    var reservationsId= $("#reservationsId").val();
    var doctor = $("#userName").val();
    var des = $("#diagnosisContent").val();
    if (des == "" || des == null) {
        alert("添加看诊记录不能为空");
        count = 0;
        return;
    }
    var diagnosisContent = des.replace(/\r\n/g, '<br/>').replace(/\n/g, '<br/>').replace(/\s/g, ' ');
    count++;
    if (count == 1) {
        $.ajax({
            url: Feng.ctxPath + "/customer/add_diagnosisContent1",
            type: "post",
            data: {
                id: id,
                reservationsId: reservationsId,
                doctor: doctor,
                diagnosisContent: diagnosisContent
            },
            success: function (data) {
                Feng.success('操作成功!');
                window.location.href = Feng.ctxPath + '/doctorDetails/doctor_seeDiagnosis/' + id + '/' + 4
            },
            error: function (data) {
                alert('没有权限，请联系系统管理员!');
                count = 0;
                window.location.href = Feng.ctxPath + '/doctorDetails/doctor_seeDiagnosis/' + id + '/' + 4
            }
        });
    }
};

$(".showBoxed").click(function () {
    $(this).parent().siblings().children('.hideBoxs').show();
    $(this).parent().siblings().css('box-shadow','0 0 5px #666666');
});

$(".cancel").click(function () {
    $(this).parents('.hideBoxs').hide().parent().css('box-shadow','0 0 0 white');
});